import { DefinePlugin } from 'webpack'

/**
 * @Description:
 * @Author: saqqdy
 * @LastEditors: saqqdy
 * @Date: 2021-07-18 00:39:35
 * @LastEditTime: 2021-07-18 12:01:24
 * @example
 * const config = {
 *     isProd: true
 * }
 */
import { isDev, isDevServer, isProd, mode } from '../utils/env'

const config = {
    'process.env': {
        NODE_ENV: JSON.stringify(mode)
    },
    IS_PROD: isProd,
    IS_DEV: isDev,
    IS_DEV_SERVER: isDevServer
}

export const definePlugin = new DefinePlugin(config)
